<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let p = new Promise((resolve, reject) => {
            reject('ok');
        })

        
        .then(v=>v,r=>Promise.reject(r))
        .then(v=>v,r=>Promise.reject(r))
        // then方法，
        //       默认的成功的回调函数  v=>v  function(v){return v;}
        //       默认失败的回调函数 
        //             1. 得返回一个失败的promise    
        //             2. 失败的结果值能够向下传递
        //      reason =>  Promise.reject(reason);
        //      function(reason){return Promise.reject(reason)}
        .then(value => {
            console.log(value);
        },reason=>{
            console.log('失败： ',reason);
        })

        function fn(a=1){
            console.log(a);
        }
    </script>
</body>

</html>